import requests
import re



ret = requests.get("https://www.sanchuangedu.cn")
text = ret.text
print(ret.text)


ret1 = re.findall(r'<img src="(.*?\.[jpg|png]{3})"',text)
print(ret1)
suffix = re.findall(r'<img src=".*?\.([jpg|png]{3})"',text)
print(suffix)

k = 0
for i,j in zip(ret1,suffix):
    k +=1
    image = f"https://www.sanchuangedu.cn/{i}"
    imgs = requests.get(image).content
    print(i)
    print(image)


    print(f'{k}.{j}正在保存')
    with open(f'../photo/+{str(k)}.{j}','wb') as f:
        f.write(imgs)

print("保存完毕")